<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>券管理</title>
		<link rel="stylesheet" type="text/css" href="../../../plugin/kindeditor/themes/default/default.css" />
		<link type="text/css" rel="stylesheet" href="../../../css/index.css" />
		<link type="text/css" rel="stylesheet" href="../../../layui/css/layui.css" />
		<link type="text/css" rel="stylesheet" href="../../../css/store/store.css" />
		<link type="text/css" rel="stylesheet" href="../../../css/store/addStore.css" />
		<link type="text/css" rel="stylesheet" href="../../../css/manage/addTicketList.css" />
	</head>
	<body>
		<header></header>
		<div id="menu"></div>
		<div class="content">
			<div class="content-title">
				<ul class="clearfix">
					<li>券管理</li>
					<li>添加优惠券</li>
				</ul>
			</div>
			<div class="content-table">
				<div class="infoBox">
					<div class="baseItem">
						<div class="info-title">
							<span>基本信息</span>
							<input type="button" value="发券规则" id="rule" class="layui-btn rule" />
						</div>
						<div class="baseForm">
							<form class="layui-form" action="">
								<div class="layui-form-item">
									<label class="layui-form-label"><span style="color:red;">*</span>关联商品：</label>
									<div class="layui-input-block addStore" style="width:590px;">
										<input type="text" name="" required  lay-verify="required" placeholder="请输入商品链接" autocomplete="off" class="layui-input">
										<input type="button" value="添加商品" class="layui-btn add-btn" style="height:31px !important;line-height: 31px !important;"/>
									</div>
									<div class="layui-form-mid layui-word-aux">注意：只能添加一款商品</div>
								</div>
								<div class="layui-form-item">
									<label class="layui-form-label">排序：</label>
									<div class="layui-input-block" style="width:590px;">
										<input type="text" name="" required lay-verify="required" placeholder="" autocomplete="off" class="layui-input">
									</div>
								</div>
								<div class="layui-form-item">
									<label class="layui-form-label">支付乐币：</label>
									<div class="layui-input-block tongyiW" style="">
										<input type="text" name="" required  lay-verify="required" placeholder="" autocomplete="off" class="layui-input" style="display: inline-block;width:590px;">
										<span class="layui-form-mid layui-word-aux danwei" >乐币</span>
									</div>
									<div class="layui-form-mid layui-word-aux prompt" >注：需支付相应乐币，优惠券方能发布成功。</div>
									<div class="layui-form-mid layui-word-aux prompt">计算公式举例：商品价100元*50%*100LB（100LB＝1元）＝5000LB</div>
								</div>
								<div class="layui-form-item">
									<label class="layui-form-label" style="width:120px !important;"><span style="color:red;">*</span>优惠券名称：</label>
									<div class="layui-input-block addStore" style="margin-left:120px;width:590px;">
										<input type="text" name="" required  lay-verify="required" placeholder="仅限某商品使用仅限某商品使用仅限" autocomplete="off" class="layui-input">
									</div>
								</div>
								<div class="layui-form-item">
									<label class="layui-form-label"><span style="color:red;">*</span>折扣券：</label>
									<div class="layui-input-block tongyiW" style="">
										<input type="text" name="" required  lay-verify="required" placeholder="" autocomplete="off" class="layui-input" style="display: inline-block;width:93%;">
										<span class="layui-form-mid layui-word-aux danwei" >折</span>
									</div>
								</div>
								<div class="layui-form-item">
									<label class="layui-form-label"><span style="color:red;">*</span>发放数量：</label>
									<div class="layui-input-block tongyiW" style="">
										<input type="text" name="" required  lay-verify="required" placeholder="" autocomplete="off" class="layui-input" style="display: inline-block;width:93%;">
										<span class="layui-form-mid layui-word-aux danwei" >张</span>
									</div>
								</div>
								<div class="layui-form-item">
									<label class="layui-form-label" style="width:120px;"><span style="color:red;">*</span>有效时间：</label>
									<div class="layui-input-block">
										<input type="text" class="layui-input" id="publish" placeholder="开始 到 结束" style="width:590px;">
									</div>
								</div>
								<div class="layui-form-item" style="text-align: center;">
									<input type="button" value="取消" class="layui-btn cancel"/>
									<input type="button" value="确定" class="layui-btn"/>
								</div>
							</form>
						</div>
					</div>
				</div>
			</div>
		</div>
	</body>
	<div id="voucherRule">
		<div class="ruleMess scrollbar">
			<p class="one">商户发布折扣商品需先行充值商品平台价50%的等额乐币至平台账户中，充值上限<span class="active">300</span>元。
				<span class="active">（例：商品平台价10元，则需充值乐币数为10元*50%=5元=500乐币）</span>
			</p>
			
      <p class="one active">折扣券发布流程：</p>
      <p class="one">商户后台——优惠券管理——添加折扣商品券——关联一款商品——乐币支付——冻结相应乐币余额——发布成功</p>

      <p class="one active">注释：</p>
     <p class="one">1.商户发布对应商品的折扣券时需保持乐币账户余额大于或等于所发布商品需充值乐币数。</p>
     <p class="one">2.折扣券活动结束后，商户所充值乐币一次性返还至商户乐币账户中。</p>
     <p class="one">3.商户充值乐币可用于发布其它商品折扣券、发布红包视频等营销行为或用于购买其他商户商品。</p>
     <p class="one">4.当所有优惠券被消耗掉或所有优惠券超出使用时效作废（至少7天）时，冻结乐币余额被解冻，此时乐币可用于促销、发布红包视频或购买其它商家的商品。</p>
		</div>
		<div class="layerBtn">
			<div class="layui-form-item">
				<div class="layui-inline">
					<div class="layui-input-inline clearfix btnList">
						<input type="submit" data-type="save" id="yes" value="知道啦" class="layui-btn" />
					</div>
				</div>
			</div>
		</div>
		
	</div>
	<script src="../../../js/plugIn/jquery-3.3.1.min.js"></script>
	<script src="../../../layui/layui.all.js"></script>
	<script>
		var menuList = "quanguanli";
		var menuSec = "quanliebiao";
		$('header').load('../home.html');
		$('#menu').load('../menu.html');
		$(function(){
				var element = layui.element; //导航的hover效果、二级菜单等功能，需要依赖element模块
				var table = layui.table;
				var laydate = layui.laydate;
				var layer = layui.layer;
				var laypage  = layui.laypage ;
				var upload = layui.upload;
				var jquery = layui.jquery;
				//多图片上传
				upload.render({
					elem: '.uploadBtn'
					/* ,url: '/upload/' */
					,multiple: true
					,before: function(obj){
						//预读本地文件示例，不支持ie8
						console.log(obj);
						obj.preview(function(index, file, result){
							$('#demo2').append('<li><img  src="'+ result +'" alt="'+ file.name +'"/></li>');
							$('#demo2 li:gt(0)').each(function(){
								if($(this).find('span').size()<=0){
									$(this).append('<span class="delStoreImg"></span>');
								}
							})
						});
					}
					,done: function(res){
						//上传完毕
						
					}
				});
				
				//自定义格式
				laydate.render({
					elem: '#publish'
					,type: 'datetime'
					,range: '到'
					,format: 'yyyy/M/d'
					,min:0
				});
			/* 删除上传图片操作 */
			$(document).on('click','.delStoreImg',function(){
				$(this).parent().remove();
			});
			
			$("#rule").click(function(){
				layer.open({
					type: 1,
					title:'发券规则说明',
					align:'center',
					content: $('#voucherRule'),
					area: ['640px', '470px'], //宽高
					cancel: function(){ 
							$('#voucherRule').css('display','none');
						}
				})
			});
			$(document).on('click','#yes',function(){
				$('#voucherRule').css('display','none');
				layer.closeAll();
			})
		})
	</script>
</html>